<template>
  <div class="share_dialog" v-if="visible">
    <!-- 分享弹窗主体 -->
    <div class="share_content">
      <div class="share_title">
        <div>您的邀请码</div>
        <div class="close_btn" @click="visible = false">
          <img src="@/assets/common/close_icon.png" alt="" />
        </div>
      </div>
      <div class="invite_code">XIAODAISG584</div>
      <div class="copy_btn">点击复制</div>
      <div class="qr_code">
        <img src="@/assets/profile/security/qrcode_img.png" alt="">
      </div>
      <div class="operate_btn">分享</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';

// 是否显示
const visible = ref(false)

defineExpose({
  visible
})

</script>

<style lang="scss" scoped>
.share_dialog {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0px;
  left: 0px;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  .share_content {
    width: 80vw;
    background-color: #202126;
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    .share_title {
      position: relative;
      .close_btn {
        position: absolute;
        right: 0;
        top: 0
      }
    }

    .invite_code {
      margin: 10px;
      background-color: #2c2c30;
      border-radius: 5px;
      padding: 5px 30px;
      font-size: 20px;
      display: inline-block;
      color: #11e55b;
    }
    .copy_btn {
      text-decoration: underline;
      color: #4EA1FF;
    }
    .qr_code {
      margin: 20px auto;
      width: 150px;
      height: 150px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .share_btn {
      margin: 0px auto;
      background: linear-gradient(to right, #14da62, #0d5eae);
      width: 60vw;
      padding: 10px;
      border-radius: 20px;
    }
  }
}
</style>
